package org.test.pong.utils

import spock.lang.Shared
import spock.lang.Specification

class RateLimiterDiyTest extends Specification{

    @Shared
    RateLimiterDiy rateLimiterDiy

    //initialize
    def setupSpec(){
        rateLimiterDiy = new RateLimiterDiy()
    }
    //test method
    def "test rate limiter"(){
        when:
        def result
        for (int i=0;i<10;i++){
            result = rateLimiterDiy.tryInvoke()
            println("result:"+result)
        }
        then:
        println("done")
    }
}
